/**
 * Scheduler Prototypes and Type Definitions
 */
typedef struct event event;
typedef struct schedule schedule;
typedef struct schedule_list schedule_list;

struct event {
  struct timeval *timestamp;
  event* next;
  schedule *(*job) (void *);
  void * args;
};

struct schedule {
  event* head;
};

struct schedule_list {
  schedule_list *next;
  unsigned long int key;
  schedule *s;
};

void swap(schedule *, event *, event *);
void bubble_sort(schedule *);
schedule * join_schedules(schedule *, schedule *);
schedule * make_schedule(int, ...);
event * next_event(schedule *);
